﻿Imports System.Data.OleDb
Public Class Likedeal
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        img_like.Visible = False

    End Sub

    Protected Sub btn_like_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_like.Click
        img_like.Visible = True
        btn_like.Visible = False
        Dim oleDbConn = New OleDbConnection(ConfigurationManager.ConnectionStrings("DealsDbConnection").ConnectionString)
        Dim sql = "INSERT INTO  Userlike(Dealid,Reader) VALUES (@f1,@f2)"
        Dim oleDbcmd = New OleDbCommand(sql, oleDbConn)
        oleDbConn.Open()
        oleDbcmd.Parameters.AddWithValue("f1", Request.Params("ID"))
        oleDbcmd.Parameters.AddWithValue("f2", User.Identity.Name)

        oleDbcmd.ExecuteNonQuery()
        oleDbConn.Close()
        oleDbcmd.Dispose()
        oleDbConn.Dispose()
    End Sub
End Class